package com.ceshi.mvpdemo.Model;


import android.os.Handler;

import com.ceshi.mvpdemo.Presenter.MvpCallback;

public class MvpModel {

    public static void getNetData(final String param, final MvpCallback callback){

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
               switch (param){
                   case "normal":
                       callback.onSuccess("请求成功返回的数据为:"+param);
                       break;
                   case "failure" :
                       callback.onFailure("请求失败，参数有误");
                       break;
                   case "error" :
                       callback.onError();
                       break;
               }
                callback.onComplete();
            }
        },2000);

    }
}
